package com.iot.manager.data.models;

import com.google.gson.annotations.SerializedName;

public class DeviceConfig {
    @SerializedName("samplingInterval")
    private Integer samplingInterval;

    @SerializedName("uploadInterval")
    private Integer uploadInterval;

    @SerializedName("alarmThresholds")
    private AlarmThresholds alarmThresholds;

    @SerializedName("wifi")
    private WifiConfig wifi;

    @SerializedName("mqtt")
    private MqttConfig mqtt;

    // 用于设备配置的临时字段
    private String hotspotSsid;
    private String hotspotPassword;
    private String serverUrl;
    private String serverPort;
    private String wifiSsid;
    private String wifiPassword;

    public static class AlarmThresholds {
        @SerializedName("temperature")
        private TemperatureThresholds temperature;

        @SerializedName("humidity")
        private HumidityThresholds humidity;

        public TemperatureThresholds getTemperature() {
            return temperature;
        }

        public void setTemperature(TemperatureThresholds temperature) {
            this.temperature = temperature;
        }

        public HumidityThresholds getHumidity() {
            return humidity;
        }

        public void setHumidity(HumidityThresholds humidity) {
            this.humidity = humidity;
        }
    }

    public static class TemperatureThresholds {
        @SerializedName("high")
        private Double high;

        @SerializedName("low")
        private Double low;

        public Double getHigh() {
            return high;
        }

        public void setHigh(Double high) {
            this.high = high;
        }

        public Double getLow() {
            return low;
        }

        public void setLow(Double low) {
            this.low = low;
        }
    }

    public static class HumidityThresholds {
        @SerializedName("high")
        private Double high;

        @SerializedName("low")
        private Double low;

        public Double getHigh() {
            return high;
        }

        public void setHigh(Double high) {
            this.high = high;
        }

        public Double getLow() {
            return low;
        }

        public void setLow(Double low) {
            this.low = low;
        }
    }

    public static class WifiConfig {
        @SerializedName("ssid")
        private String ssid;

        @SerializedName("password")
        private String password;

        public String getSsid() {
            return ssid;
        }

        public void setSsid(String ssid) {
            this.ssid = ssid;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }
    }

    public static class MqttConfig {
        @SerializedName("server")
        private String server;

        @SerializedName("username")
        private String username;

        @SerializedName("password")
        private String password;

        public String getServer() {
            return server;
        }

        public void setServer(String server) {
            this.server = server;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }
    }

    public Integer getSamplingInterval() {
        return samplingInterval;
    }

    public void setSamplingInterval(Integer samplingInterval) {
        this.samplingInterval = samplingInterval;
    }

    public Integer getUploadInterval() {
        return uploadInterval;
    }

    public void setUploadInterval(Integer uploadInterval) {
        this.uploadInterval = uploadInterval;
    }

    public AlarmThresholds getAlarmThresholds() {
        return alarmThresholds;
    }

    public void setAlarmThresholds(AlarmThresholds alarmThresholds) {
        this.alarmThresholds = alarmThresholds;
    }

    public WifiConfig getWifi() {
        return wifi;
    }

    public void setWifi(WifiConfig wifi) {
        this.wifi = wifi;
    }

    public MqttConfig getMqtt() {
        return mqtt;
    }

    public void setMqtt(MqttConfig mqtt) {
        this.mqtt = mqtt;
    }

    public String getHotspotSsid() {
        return hotspotSsid;
    }

    public void setHotspotSsid(String hotspotSsid) {
        this.hotspotSsid = hotspotSsid;
    }

    public String getHotspotPassword() {
        return hotspotPassword;
    }

    public void setHotspotPassword(String hotspotPassword) {
        this.hotspotPassword = hotspotPassword;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }

    public String getServerPort() {
        return serverPort;
    }

    public void setServerPort(String serverPort) {
        this.serverPort = serverPort;
    }

    public String getWifiSsid() {
        return wifiSsid;
    }

    public void setWifiSsid(String wifiSsid) {
        this.wifiSsid = wifiSsid;
    }

    public String getWifiPassword() {
        return wifiPassword;
    }

    public void setWifiPassword(String wifiPassword) {
        this.wifiPassword = wifiPassword;
    }
} 